//
// Source code recreated from ConfigVo .class file by IntelliJ IDEA
// (powered by Fernflower decompiler)
//

package com.ht.modules.system.online.cgreport.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import com.ht.utils.oConvertUtils;
import com.ht.modules.system.online.cgreport.entity.OnlCgreportItem;
import com.ht.modules.system.online.cgreport.mapper.OnlCgreportItemMapper;
import com.ht.modules.system.online.cgreport.service.IOnlCgreportItemService;
import org.springframework.stereotype.Service;

@Service
public class OnlCgreportItemServiceImpl extends ServiceImpl<OnlCgreportItemMapper, OnlCgreportItem> implements IOnlCgreportItemService {
    public OnlCgreportItemServiceImpl() {
    }

    public List<Map<String, String>> getAutoListQueryInfo(String cgrheadId) {
        LambdaQueryWrapper<OnlCgreportItem> query = new LambdaQueryWrapper();
        query.eq(OnlCgreportItem::getCgrheadId, cgrheadId);
        query.eq(OnlCgreportItem::getIsSearch, 1);
        List<OnlCgreportItem> fieldList = this.list(query);
        List<Map<String, String>> list = new ArrayList<>();
        int i = 0;

        HashMap map;
        for(Iterator var6 = fieldList.iterator(); var6.hasNext(); list.add(map)) {
            OnlCgreportItem item = (OnlCgreportItem)var6.next();
            map = new HashMap();
            map.put("label", item.getFieldTxt());
            if (oConvertUtils.isNotEmpty(item.getDictCode())) {
                map.put("view", "list");
            } else {
                map.put("view", item.getFieldType());
            }

            map.put("mode", item.getSearchMode());
            map.put("field", item.getFieldName());
            ++i;
            if (i > 2) {
                map.put("hidden", "1");
            }
        }

        return list;
    }
}
